import {getStoreDetail} from '../../api/storeDetail.js'
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    storeId: '', // 店铺id
    TitleBarHeight: app.globalData.TitleBarHeight,
    storeInfo: null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      storeId: options.shopId
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    this.init()    
  },
  async init() {
    const data = await getStoreDetail({id: this.data.storeId})

    this.setData({
      storeInfo: data
    })    
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  goBack() {
    wx.navigateBack()
  },
  phoneCall() {

  },
  onTabsChange(event) {
    console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
  },

  onTabsClick(event) {
    console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
  }
})